package com.core.utils;

import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;

/**
 *
 */
public class JarLoader extends URLClassLoader {

    public JarLoader(URL[] urls) {
        super(urls);
    }

    public void addFile(String path) throws MalformedURLException {
        String urlPath = "jar:file:///" + path + "!/";
        addURL(new URL(urlPath));
    }
}
//For Example:
//this.jarLoader.addFile(serviceInfo.getJarPath());
//IService service = (IService) jarLoader.loadClass(serviceInfo.getMainClass()).newInstance();